import yaml

from engine.project import ProjectLoaderBase

class JSONBasedProjectLoader(ProjectLoaderBase):
    def __init__(self, file_path):
        super().__init__(file_path)

    def load_project(self, dir_path):
        config = self.load_project_config(f'{dir_path}/project.yaml')
        super().load_project(dir_path, config)

    def load_file(self, file_path):
        with open(file_path) as f:
            data = yaml.load(f)
            f.close()
        return data

    def get_export_data(self):
        return super().get_export_data('project.yaml')
